<!--净借记限额管理通知查询页面-->
<template>
  <div class="app-container">
    <ht-search-form
      v-show="showSearch"
      :dictMap="dictMap"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
      defaultEventKey="queryTable"
    ></ht-search-form>
    <ht-table
      ref="dataTable"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      :opButtonList="opButtonList"
      :randomRowKey="true"
      defaultEventKey="queryTable"
    >
      <template v-slot:operate>
        <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '明细',
                  // permission: 'user:xxx:xxx',
                  doFunc: () => {
                    handleAction('detials', scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>
    <!-- 明细弹出框 -->
    <noti-details ref="notiDetailsDialog" :dictMap="dictMap" :formData.sync="formData"></noti-details>
  </div>
</template>
<script>
import { apiUrlConfig, detail } from "@/api/cnaps/nets/AcctLimtWarn/net_noti_query.js";
import NotiDetails from "./components/notiDetails";
import { listPageMixin } from "@/libs/listPageMixin";
import { log } from "util";

export default {
  name: "netNotiQuery",
  mixins: [listPageMixin],
  components: {
    NotiDetails,
  },
  data() {
    return {
      reqConfig: apiUrlConfig,
      total: 0,
      dataList: [],
      //数据字典
      searchFormDictList: [
        "PROCESSSTATUS",
        "NTFCTN_TYPE",
        "PROCESSSTATUS",
        "SYSTEMCODE",
        "OPR_CLASS",
        "OPERATIONTYPECODE",
        "SWITCHTYPECODE",
        "LC03_NTFCTN_TYPE",
      ],
      //  明细弹框数据
      // form表单字段
      formData: {
        id: "",
        pkgId: "",
        workDate: "",
        directReceiver: "",
        directReceiverName: "",
        ntfctnType: "",
        lc00OprClass: "",
        lc00OprType: "",
        lc00StBrno: "",
        lc00StBrnoName: "",
        cdtldCurcd: "",
        lc00Cdtld: "",
        ttlpldgCurcd: "",
        lc00Ttlpldgval: "",
        cdtxtnsnCurcd: "",
        lc00Cdtxtnsnlmt: "",
        netdbtCurcd: "",
        lc00Netdbtlmt: "",
        avlblCurcd: "",
        lc00Avlblnetdbt: "",
        lc01SwitchType: "",
        lc01WatchBrno: "",
        lc01WatchBrnoName: "",
        wrngCurcd: "",
        lc01Avlblnetdbtwrngval: "",
        lc02DirectBrno: "",
        lc02DirectBrnoName: "",
        dstrbtnpldgCurcd: "",
        lc02Dstrbtnpldgval: "",
        lc03LpBrno: "",
        lc03LpBrnoName: "",
        lc03NtfctnType: "",
        lc03OrgnlnotCurcd: "",
        lc03Orgnlnotdstrbtn: "",
        lc03OrgnlisCurcd: "",
        lc03Orgnlisdstrbtn: "",
        notCurcd: "",
        lc03Notdstrbtn: "",
        isCurcd: "",
        lc03Isdstrbtn: "",
        lc04LpBrno: "",
        lc04LpBrnoName: "",
        lc04OrgnlnotCurcd: "",
        lc04Orgnlnotdstrbtn: "",
        lc04OrgnlisCurcd: "",
        lc04Orgnlisdstrbtn: "",
        forcedwnCurcd: "",
        lc04Forcedwn: "",
        lc04Brnchqty: "",
        rcvTime: "",
        remarks: "",
      },
      showSearch: true,
      // 查询参数
      queryParams: {
        id2: "",
        cpgdate: "",
        cpgdate2: "",
        workDate: "",
        workDate2: "",
      },
      formOptions: [],
      opButtonList: () => {
        return [];
      },
      tableBindColumns: [
        { label: `交易流水号`, prop: "id", width: "170", sortable: false },
        {
          label: `CPG日期`,
          prop: "vdate",
          sortable: false,
          type: "date",
        },
        {
          label: `工作日期`,
          prop: "workDate",
          sortable: false,
          type: "date",
        },
        {
          label: `接收参与机构`,
          prop: "directReceiver",
          width: "160",
          sortable: false,
        },
        {
          label: `通知类型`,
          prop: "ntfctnType",
          dictCode: "NTFCTN_TYPE",
          sortable: false,
        },
        {
          label: `报文接收时间`,
          prop: "rcvTime",
          sortable: false,
          type: "date",
        },
      ],
    };
  },
  mounted() {
    this.formOptions = [
      {
        type: "input",
        prop: "id2",
        defaultAttr: {
          label: "交易流水号",
          placeholder: "请输入交易流水号",
        },
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "cpgdate",
          endTimeName: "cpgdate2",
        },
        defaultAttr: {
          label: "CPG日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "workDate",
          endTimeName: "workDate2",
        },
        defaultAttr: {
          label: "工作日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      },
    ];
  },
  methods: {
    editComplete(state) {
      if (state == true) {
      }
    },
    handleAction(type, row = {}) {
      switch (type) {
        case "detials":
          // 明细信息
          detail({ id: row.id, ntfctnType: row.ntfctnType }).then((res) => {
            this.formData = _.clone(res.result.data);
            this.$refs.notiDetailsDialog.show();
          });
          break;
      }
    },
  },
};
</script>
